from django.conf.urls.defaults import *
from settings import ROOT, DEBUG
import os

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = patterns('',
    (r'^media/video/(?P<path>.*)$', 'django.views.static.serve',
        {'document_root': os.path.join(ROOT, 'apps', 'video', 'media', 'video'), 'show_indexes': DEBUG}),
    (r'^media/(?P<path>.*)$', 'django.views.static.serve',
        {'document_root': os.path.join(ROOT, 'media'), 'show_indexes': DEBUG}),
)

urlpatterns += patterns('apps.video.views',
    # Example:
    # (r'^StreamVideoManagement/', include('StreamVideoManagement.foo.urls')),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # (r'^admin/(.*)', admin.site.root),
    (r'^$', 'rVideoList'),
    (r'^cvideo/$', 'cVideo'),
    (r'^(?P<video_id>[0-9]+)/$', 'rVideo'),
    (r'^(?P<video_id>[0-9]+)/flv/.*$', 'rVideoByEmbed', {'type': 'flv'}),
    (r'^(?P<video_id>[0-9]+)/xml/$', 'rVideoByEmbed', {'type': 'xml'}),
)
